package com.design.fill;

import com.design.util.moveBox.Box;
import com.design.util.moveBox.MapMethod;
import com.design.util.moveBox.Picture;

import java.awt.*;

public class FillBox {
    private FillBox(){}
    public static void fill(Graphics g, MapMethod method,int windowWidth, int playX, int playY){
        Box[][] map = method.getMap();
        int playerX = method.getPlayerX();
        int playerY = method.getPlayerY();
        int boxWidth = windowWidth / map.length;
        for (Box[] boxes : map) {
            for (Box box : boxes) {
                box.fill(g,boxWidth,playX,playY);
            }
        }
        new Box(Picture.getPlayer(),playerX,playerY).fill(g,boxWidth,playX,playY);
    }
    public static void fill(Graphics g,MapMethod method,int windowWidth){
        fill(g,method,windowWidth,0,0);
    }
}
